import Vue from "vue";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import "./assets/index.css";
import Print from "./components/pdf/print";
import App from "./app.vue";
import router from "@/router/index.js";
import basil from "./basil";
import * as utils from "liu-es-utils/es/index";
console.log(basil, utils);
import * as bin from "./bin/index.es5";
import liu from "./hello.liu";
console.log(liu, "xxss");
console.log(bin, "bin");
const text1 = () => {
  // console.log("测试", process.env.NODE_ENV, process.env.NODE_API);
};
text1();
Vue.prototype.Print = Print;
Vue.use(ElementUI);
new Vue({
  router,
  render: h => h(App)
}).$mount("#app");
var log = {
  warn: console.warn,
  info: console.info
};
/* eslint-disable no-inner-declarations */
/* globals __webpack_hash__ */
var lastHash;
var upToDate = function() {
  return lastHash.indexOf(__webpack_hash__) >= 0;
};

var updateModules = function(updatedModules, renewedModules) {
  var unacceptedModules = updatedModules.filter(function(moduleId) {
    return renewedModules && renewedModules.indexOf(moduleId) < 0;
  });

  if (unacceptedModules.length > 0) {
    log.warn("[HMR] 模块无法被热更新，可能需要重载页面.");
    unacceptedModules.forEach(function(moduleId) {
      log.warn("[HMR]  - " + moduleId);
    });
  }

  if (!renewedModules || renewedModules.length === 0) {
    log.info("[HMR] 没有需要更新的内容.");
  } else {
    log.info("[HMR] 更新模块如下:");
    renewedModules.forEach(function(moduleId) {
      if (typeof moduleId === "string" && moduleId.indexOf("!") !== -1) {
        var parts = moduleId.split("!");
        log.info("[HMR]  - " + parts.pop());
        log.info("[HMR]  - " + moduleId);
      } else {
        log.info("[HMR]  - " + moduleId);
      }
    });
    var numberIds = renewedModules.every(function(moduleId) {
      return typeof moduleId === "number";
    });
    if (numberIds)
      log.info(
        '[HMR] Consider using the optimization.moduleIds: "named" for module names.'
      );
  }
};
module.hot
  .check(true)
  .then(function(updatedModules) {
    if (!updatedModules) {
      log.warn("[HMR] 未检查到更新，将会进行页面重载!");
      log.warn("[HMR] 可能是因为重启了C2-Dev-Server");
      // window.location.reload();
      return;
    }

    if (!upToDate()) {
      check();
    }

    updateModules(updatedModules, updatedModules);

    if (upToDate()) {
      log.info("[HMR] 应用已经更新完毕.");
    }
  })
  .catch(function(err) {
    var status = module.hot.status();
    if (["abort", "fail"].indexOf(status) >= 0) {
      log.warn("[HMR] 热更新出现错误，将进行页面重载!");
      log.warn("[HMR] " + err);
      window.location.reload();
    } else {
      log.warn("[HMR] 热更新失败: " + err);
    }
  });
